package com.csguider.auth;

import com.csguider.auth.service.SysRoleService;
import com.csguider.model.system.SysRole;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @Author <a href="https://github.com/wl2o2o">程序员CSGUIDER</a>
 * @From <a href="https://wl2o2o.github.io">CSGUIDER博客</a>
 * @CreateTime 2024/4/27
 */

@SpringBootTest
public class MpServiceTestDemo1 {
    @Autowired
    private SysRoleService sysRoleService;

    // 添加
    @Test
    public void add() {
        SysRole sysRole = new SysRole();
        sysRole.setRoleName("平民");
        sysRole.setRoleCode("pm");
        boolean save = sysRoleService.save(sysRole);
        System.out.println(save);
        List<SysRole> list = sysRoleService.list();
        list.forEach(System.out::println);
    }

    // 查询所有
    @Test
    public void getAll() {
        List<SysRole> list = sysRoleService.list();
        System.out.println(list);
    }


}
